Skip to main content

Visualization Element: Trend

Symbol:

_visu_icon_trend_neu.png

Category: Special Controls

The element displays the curve of variable values as a trend diagram. The trend diagram is suitable for representing a long-term data curve because the data is read from a trend recording and hence from a database. Moreover, you can run the Trend element together with the Date Range Picker, Legend, and Time Range Picker operating elements so that the user can navigate conveniently in the diagram.

Tip

You can programmatically delete the recorded trend curve at runtime. The recording starts again from the time of deletion.

For more information, see: Programming a Trend Visualization

Tip

The Trend visualization element cannot be inserted into a visualization in the POU pool.

Element properties

Are all element properties available?

All properties are available only after you select the Advanced option or the All categories filter in Properties.

Element name

Example: Velocity

Tip

Assign individual names for elements so that they are found faster in the element list.

Data source

Data source for the connection via the device and the application to the Trend Recording object where the trend data that you want to show was saved.

If the Trend Recording object is on the local device, then it is sufficient when you specify the respective application. If the trend recording is on a remote device, then you need to specify the data source connection to this device.

  • _cds_icon_application.png <local application>

    The Trend Recording object is located on the local device in the local application.

  • < device name> . < application name>

    Example: Device_A.App_A

    The Trend Recording object is located on the local device Device_A below the application App_A.

  • _visu_icon_data_sources.png < data source name >

    Example: _visu_icon_data_sources.png DataSource_B

    The Trend Recording object is located on a remote device that is connected via the data source DataSource_B. Below the (now visible) Application property, the remote application is displayed as configured in the data source.

    Example: _cds_icon_application.png App_B

    Note: If the data source is accessed symbolically by means of a symbol file CODESYS (symbolic), then the required symbol file and the corresponding project have to be saved in the same folder.

Element Type

Trend

Trend recording

_visu_icon_trend_recording_manager.png: Trend recording whose data is displayed as a diagram

The trend recording is located on the device specified in the Data source property.

For more information, see: Trend Recording

Display settings

_visu_icon_trend_diagram.png: The button opens the Display Settings.

Cursor

Show cursor

standard icon: A cursor (black triangle with vertical line) is shown in the trend diagram.

Behavior at runtime:

As soon as the graph is "drawn", the user can move the cursor along the time axis in order to mark a specific time. Then the variable value belonging to the cursor position is displayed in the legend above the graph.

_cds_img_trend_with_cursor.png

Show tooltip

Requirement: Show cursor is activated.

standard icon: A tooltip opens at the cursor.

Behavior at runtime: The variable value belonging to the cursor position is displayed as a tooltip.

Show frame

standard icon: The trend diagram is drawn with a frame.

Number format

Format definition in printf syntax, which determines how the values are displayed in the tooltip and in the legend

Example: %d (integer variable) or %5.2f (floating-point number)

Default time range

Default time value for the available time range

Example: 20s, 1m

Tick mark labels

Tip

The time stored in the trend recording are in the UTC time zone. If the time is displayed in the trend of the visualization element, then the timestamps are converted to the local time zone of the operating system of the PLC.

Change the time zone in the operating system if the times in the trend diagram are not in the zone that you need.

Tip

You can programmatically switch the local time zone of the system time to universal time (UTC).

When the variable VisuElems.Visu_DateTime.DisplayUTC is set to TRUE, the system time is displayed as universal time (UTC). By default, the variable VisuElems.Visu_DateTime.DisplayUTC is set to FALSE so that the system time is displayed in the local time zone.

For the display of date and time values, you can extend the respective format string with the time zone code Z. For an output in local system time, the offset is then displayed in universal time (UTC). For example, dd:MM:yyyy HH:mm:ss:ms:Z outputs 01.08.2021 12:00:00:001:+02:00. When universal time (UTC) is displayed, the UTC code is also displayed. 01.08.2021 10:00:00:001:Z

Time stamps

X-value of the trend diagram

  • Absolute time stamps

    The absolute time with date and time is displayed at each tick mark on the time axis.

    Example: 18.03.2016 12h30m50s

  • Relative time stamps

    The time period from the start of the recording (=0) is displayed at each tick mark.

    Example: 5m30s

Draw labels on two lines

standard icon: The timestamps are displayed on two lines (for example, the date is displayed on the first line and the time on the second line).

_cds_icon_option_deactivated.png: The timestamp is displayed on one line. Example: 2019-11-01-12:30:50.

Omit irrelevant information in timestamps

standard icon: The timestamps are displayed in a truncated form (without insignificant information). For example, the date is displayed at the first tick mark, and only the time is displayed at the following tick marks. The Internationalization (format strings) property is not visible and is ignored.

_cds_icon_option_deactivated.png: The timestamps are displayed with all information. This takes into consideration the Internationalization (format strings) property which contains the format definition for the date and time display.

Internationalization (format strings)

Format definition for the date and time display of the timestamp (when it is displayed in full)

Note

The property is visible only if the Omit irrelevant information in timestamps option is not selected.

Tip

Basically, all %t format options are supported which are described in the "Placeholders with Format Definition" chapter.

Date

Format string that returns the date display according to the defined format. The operating system locale is used as the default setting.

Options for specifying the format string

  • As a fixed string

    Example: MM/dd/yyyy

  • As a reference to a text list entry <text list name>.<ID>

    A format string is defined there for each language.

    _visu_elem_prop_formatstring_ref_to_tlentry.png
. Defined format strings for the date:
  • Year: yyyy, yy, y

  • Month: MM, M

  • Day: dd, d

  • Recommended separator: - . /

Example:

yyyy-MM-d displays 2019-10-25

yyyy-MM-dd displays 2019-10-25

dd.MM.yyyy displays 25.10.2019

dd/MM/yyyy displays 25/10/2019

DateTime.DTPicker

Time

Format string that returns the time (or time of day) display according to the defined format. The operating system locale is used as the default setting.

. Defined format strings for the time:
  • 24-hour time definition: HH, H

  • 12-hour time definition: hh, h

  • AM/PM for 12-hour time definition: tt

  • Minutes: mm, m

  • Seconds: ss, s

  • Milliseconds: ms

  • Microseconds: us

  • Recommended separator: : or space character

Example:

HH:mm:ss:ms displays 15:30:59:123

h:mm:ss tt displays 3:30:59 PM

DateTime.DTPicker

Position

The position defines the location and size of the element in the visualization window. This is based on the Cartesian coordinate system. The origin is located in the upper left corner of the window. The positive horizontal X-axis runs to the right. The positive vertical Y-axis runs downwards.

X

The X-coordinate (in pixels) of the upper left corner of the element

Example: 10

Y

The Y-coordinate (in pixels) of the upper left corner of the element

Example: 10

Width

Specified in pixels

Example: 150

Height

Specified in pixels

Example: 30

Tip

You can also change the values by dragging the box _visu_icon_position_element.png symbols to other positions in the editor.

Assigned controls

These elements are created automatically when Insert Elements for Trend Controlling is used to add the controls.

Date Range Picker

Control for changing the date and time of the displayed data sets

With _cds_icon_three_dots.png, all elements are provided that have implemented the interface IDateRangeSelector. By default, instances of the Date Range Picker visualization element are available.

Time range picker

Control for changing the time of the displayed data sets

With _cds_icon_three_dots.png, all elements are provided that have implemented the interface ITimeSelector. By default, instances of the Time Range Picker visualization element are available.

Legend

Control for displaying a legend for the graphs

With _cds_icon_three_dots.png, all elements are provided that have implemented the interface ILegendDisplayer.

Control variables

Table 12. Zoom

Zooming the displayed curve is done by means of the mouse, or the pinch gesture on a multitouch device. It also applies to all axes.

At runtime when Enable is TRUE, you can draw a box with the mouse by holding down the left mouse button. When you release the mouse button, the display zooms in on the box and the curve is magnified. To zoom in and out on a multitouch device, move two fingers together or away from each other, respectively.

Zooming and panning can work together.

Enable 

Variable (BOOL) that enables or disables zooming.

TRUE: Enables zooming

Example: PLC_PRG.xZoomEnable

Home 

Variable (BOOL)

Rising edge: Reset the displayed curve to the initial state after the display has changed due to zooming.

Example: PLC_PRG.xZoomHome

Undo 

Variable (BOOL)

Rising edge: Reset the displayed curve to the previous position after the display has changed due to zooming.

Example: PLC_PRG.xZoomUndo

Is zoomed 

Variable (BOOL) that indicates whether or not the displayed curve was modified due to zooming.

TRUE: Curve setting was zoomed.

Example: PLC_PRG.xIsZoomed



Table 13. Pan

Panning the displayed curve is done by means of the mouse or the pinch gesture on a multitouch device. It also applies to all axes.

At runtime if Enable is TRUE, then you can drag the displayed curve to another position by holding down the left mouse button. To pan the displayed curve on a multitouch device, drag it with one finger to another position.

Enable 

Variable (BOOL) to enable or disable panning.

TRUE: Enables panning

Example: PLC_PRG.xPanEnable

Home 

Variable (BOOL)

Rising edge: Reset the displayed curve to the initial position after the display has changed due to panning.

Example: PLC_PRG.xPanHome

Is panned 

Variable (BOOL) whose state indicates whether or not the displayed curve was modified due to zooming.

TRUE: Curve setting was panned.

Example: PLC_PRG.xIsPanned



Enable for Y-axis 

Variable (BOOL) to enable the zoom or pan action also for the Y axis

TRUE: The Y axis is enabled.

The control variables described below (Date Range Start and Date Range End) can be used to programmatically control the time range of the trend. This allows you to program your trend visualization without the Time Range Picker visualization element.

However, if you want a visualization user to be able to specify a time range as well, then add the time range picker element. The times in the time range picker element and in the IEC variables are automatically kept synchronized.

Note: Make sure that each trend has its own variable, otherwise the trend recording will stop.

Hint: To give the user an indication of why the trend has been halted, the _visu_icon_trend_stopped.png symbol is displayed at the end of the trend axes. When this symbol appears, the current trend has been halted because either Zoom or Pan are active, or because the time range is restricted to older values by variables.

Date Range Start 

IEC variable (DATE_AND_TIME, DT, LDATE_AND_TIME, LDT) for the start time of the time range. For the DT data type, an accuracy of 1s is achieved.

If the value changes, then the trend recording is stopped.

Example: PLC_PRG.ldtStart. Only one variable (no literal) is allowed.

Date Range End 

IEC variable (DATE_AND_TIME, DT, LDATE_AND_TIME, LDT) for the end time of the time range.

For the DT data type, an accuracy of 1s is achieved.

If the value changes, then the trend recording reacts as follows: When the value increases, the trend recording is started. When the value decreases, the trend recording is ended.

Example: PLC_PRG.ldtEnd. Only one variable (no literal) is allowed.

Center

The properties contain fixed values for the coordinates of the point of rotation. The rotation point is displayed in the editor as the _visu_icon_center_point.png symbol and is used as the center for rotation and scaling.

Tip

You can also change the values by dragging the _visu_icon_center_point.png symbol to another position in the editor.

X

X-coordinate of the point of rotation

Y

Y-coordinate of the point of rotation

Absolute movement

The properties can be assigned to IEC variables for controlling the position of the element dynamically. The reference point is the upper left corner of the element. At runtime, the entire element is moved.

Movement

X

  • Variable (numeric data type) for the X-position (in pixels)

    Example: PLC_PRG.iPos_X

Increasing this value at runtime moves the element to the right.

Y

Increasing this value at runtime moves the element downwards.

Rotation

Variable (numeric data type) for the angle of rotation (in degrees)

Example: PLC_PRG.iAngle1

The midpoint of the element rotates at the Center point. This rotation point is shown as the _visu_icon_center_point.png symbol.

At runtime, the alignment of the element remains the same with respect to the coordinate system of the visualization. Increasing the value rotates the element to the right.

_visu_img_prp_rotation.png

Interior rotation

Variable (numeric data type) for the angle of rotation (in degrees)

Example: PLC_PRG.iAngle2

At runtime, the element rotates about the point of rotation specified in Center according to the value of the variable. In addition, the alignment of the element rotates according to the coordinate system of the visualization. Increasing the value in the code rotates clockwise.

The rotation point is shown as the _visu_icon_center_point.png symbol.

Note

If a static angle of rotation is specified in the Position → Angle property, then the static angle of rotation is added to the variable angle of rotation (offset) when the visualization is executed.

_visu_img_prp_inner_rotation.png

Tip

You can combine the variables to a Unit conversion.

Tip

The X, Y, Rotation, and Interior rotation properties are supported by the "Client Animation" functionality.

Relative movement

The properties contains variables for moving the element. The reference point is the position of the element (Position property). The shape of the element can change.

Movement top-left

X

  • Variable (integer data type) for the number (in pixels) which the left edge is moved horizontally

    Example: PLC_PRG.iDeltaX

Incrementing the value moves the element to the right.

Y

  • Variable (integer data type)for the number (in pixels) which the top edge is moved vertically

    Example: PLC_PRG.iDeltaY

Incrementing the value moves the element to the down.

Movement bottom-right

X

  • Variable (integer data type) for the number (in pixels) which the right edge is moved horizontally.

    Example: PLC_PRG.iDeltaWidth

  • Container variable: Container.Width

    For more information, see: Optimally Adjusting the Position and Size

Incrementing the value moves the element to the right.

Y

  • Variable (integer data type)for the number (in pixels) which the bottom edge is moved vertically

    Example: PLC_PRG.iDeltaHeight

  • Container variable: Container.Height

    For more information, see: Optimally Adjusting the Position and Size

Incrementing the value moves the element to the down.

Relative movement

The properties contains variables for moving the element. The reference point is the position of the element (Position property). The shape of the element can change.

. Movement point[0]
  • X

  • Y

Variable (numeric data type) for the number (in pixels) which the starting point of the line is moved.

Incrementing the X value moves the element to the right.

Incrementing the Y value moves the element to the down.

. Movement point[0]
  • X

  • Y

Variable (numeric data type) for the number (in pixels) that the end point of the line is moved.

Incrementing the X value moves the element to the right.

Incrementing the Y value moves the element to the down.

Relative movement

The properties contains variables for moving the element. The reference point is the position of the element (Position property). The shape of the element can change.

Movement top-left

X

  • Variable (integer data type) for the number (in pixels) which the left edge is moved horizontally

    Example: PLC_PRG.iDeltaX

Incrementing the value moves the element to the right.

Y

  • Variable (integer data type)for the number (in pixels) which the top edge is moved vertically

    Example: PLC_PRG.iDeltaY

Incrementing the value moves the element to the down.

Movement bottom-right

X

  • Variable (integer data type) for the number (in pixels) which the right edge is moved horizontally.

    Example: PLC_PRG.iDeltaWidth

  • Container variable: Container.Width

    For more information, see: Optimally Adjusting the Position and Size

Incrementing the value moves the element to the right.

Y

  • Variable (integer data type)for the number (in pixels) which the bottom edge is moved vertically

    Example: PLC_PRG.iDeltaHeight

  • Container variable: Container.Height

    For more information, see: Optimally Adjusting the Position and Size

Incrementing the value moves the element to the down.

State variables

The variables control the element behavior dynamically.

Invisible

Variable (BOOL) for toggling the visibility of the element

TRUE: The element is not visible at runtime.

Tip

The Invisible property is supported by the "Client Animation" functionality.

Animation

Tip

These properties are available only when you have selected the Support client animations and overlay of native elements option in the Visualization Manager.

Animation duration

Variable for the duration (in milliseconds) in which the element runs an animation

  • Variable (integer value)

    Example: Menu.tContent with VAR tContent : INT := 500; END_VAR

  • Integer literal

    Example: 500

. Animatable properties
  • Absolute movement, Movement, X, Y

  • Absolute movement, Rotation

  • Absolute movement, Interior rotation

  • Absolute movement, Exterior rotation

The animated movement is executed when at least one value of an animatable property has changed. The movement then executed is not jerky, but is smooth within the specified animation duration. The visualization element travels to the specified position while rotating dynamically. The transitions are smooth.

Move to foreground

Variable (BOOL) for setting the element in the foreground

TRUE: At runtime, the visualization element is displayed in the foreground.

FALSE: At runtime, the visualization element is displayed in the layer where it was inserted in the visualization editor.

Example: bIsInForeground with VAR bIsInForeground : BOOL := FALSE; END_VAR

Access Rights

Note

Available only when a user management is set up for visualization.

Access Rights button

Opens the Access Rights dialog. There you can edit the access privileges for the element.

. Status messages:
  • Not set. Full rights.: Access rights for all user groups : operable

  • Rights are set: Limited rights: Access is restricted for at least one group.